package org.shoukaiseki.springtest.oracledemo.project.testdemo.controller;

import org.shoukaiseki.springtest.oracledemo.framework.web.controller.BaseController;
import org.shoukaiseki.springtest.oracledemo.framework.web.page.TableDataInfo;
import org.shoukaiseki.springtest.oracledemo.project.testdemo.model.TestDemo;
import org.shoukaiseki.springtest.oracledemo.project.testdemo.service.TestDemoService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 **/
@Controller
@RequestMapping("module/testdemo")
public class TestDemoController extends BaseController {

    private String prefix = "module/testdemo";

    @Resource
    TestDemoService testDemoService;

    @RequestMapping()
    public String index(){
        return prefix+"/testdemo";
    }

    @RequestMapping("/list")
    @ResponseBody
    public TableDataInfo hello(TestDemo testDemo){
        startPage();
        List<TestDemo> list = testDemoService.selectTestDemoList(testDemo);
        return getDataTable(list);
    }

}
